home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1999 November / SOTMC_Nov1999-Ultimate.iso / mac / REALbasic ƒ / Examples / Techniques / Examples by Thomas Tempelmann / FAQs from RB-NUG mailing list / Finding duplicates in array < prev    next >
MacBinary  |  1999-07-06  |  3.4 KB  |  [clpt/drag]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Sun Apr 4 07:29:01 1999, modified Tue Jul 6 15:26:17 1999, creator 'drag', type 'clpt' "Finding duplicates in array", at 0x80 3225 bytes resource Apple HFS/HFS+ resource fork, map offset 0xc2b, map length 0x6e, data length 0xb2b, nextResourceMap 0x975f700, fileRef 0x336a, list offset 0x1c, name offset 0x6e, 4 types, 0x54455854 'TEXT' * 1 resource offset 0x22 default (weak)
99% file Adobe Photoshop Color swatch, version 0, 256 colors; 1st RGB space (0), w 0xc2b, x 0, y 0xb2b, z 0 ; 2nd space (110), w 0, x 0, y 0x7ce, z 0xa0f default (weak)
98% file data default
74% TrID Mac Text clippings (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[clpt]
macFileCreator[drag]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 1b 46 69 6e 64 69 6e | 67 20 64 75 70 6c 69 63 |..Findin|g duplic|
|00000010| 61 74 65 73 20 69 6e 20 | 61 72 72 61 79 00 00 00 |ates in |array...|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 63 6c 70 74 64 72 61 | 67 01 00 00 00 00 00 00 |.clptdra|g.......|
|00000050| 00 00 00 00 00 00 00 00 | 00 0c 99 b3 2c fd 7d b3 |........|....,.}.|
|00000060| a8 08 d9 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ff 04 00 00 |........|........|
|00000080| 00 00 01 00 00 00 0c 2b | 00 00 0b 2b 00 00 00 6e |.......+|...+...n|
|00000090| 00 00 00 00 07 ce 0a 0f | 12 1f 0d 01 00 00 00 00 |........|........|
|000000a0| 00 03 00 00 54 86 00 00 | 00 00 0a 04 00 00 00 00 |....T...|........|
|000000b0| 07 ce 0a 0f 12 25 01 01 | 00 00 00 00 00 03 00 00 |.....%..|........|
|000000c0| 54 8a 00 00 00 00 0a 04 | 00 00 00 00 07 ce 0a 0f |T.......|........|
|000000d0| 14 26 06 01 00 00 00 00 | 00 03 00 00 54 8d 00 00 |.&......|....T...|
|000000e0| 00 00 0a 04 00 00 00 00 | 07 ce 0a 0f 15 2f 2b 01 |........|...../+.|
|000000f0| 00 00 00 00 00 03 00 00 | 54 8e 00 00 00 00 0a 04 |........|T.......|
|00000100| 00 00 00 00 07 ce 0a 0f | 15 31 33 01 00 00 00 00 |........|.13.....|
|00000110| 00 03 00 00 54 90 00 00 | 00 00 0a 04 00 00 00 00 |....T...|........|
|00000120| 07 ce 0a 0f 16 26 09 01 | 00 00 00 00 00 03 00 00 |.....&..|........|
|00000130| 54 92 00 00 00 00 0a 04 | 00 00 00 00 07 ce 0a 0f |T.......|........|
|00000140| 16 27 17 01 00 00 00 00 | 00 03 00 00 54 96 00 00 |.'......|....T...|
|00000150| 00 00 0a 04 00 00 00 00 | 07 ce 0a 0f 16 3b 0a 01 |........|.....;..|
|00000160| 00 00 00 00 00 03 00 00 | 54 97 00 00 00 00 0a 04 |........|T.......|
|00000170| 00 00 00 00 07 ce 0a 0f | 17 00 33 01 00 00 00 00 |........|..3.....|
|00000180| 00 00 0a b1 67 75 69 6d | 61 20 77 72 6f 74 65 3a |....guim|a wrote:|
|00000190| 0d 0d 3e 49 20 68 61 76 | 65 20 61 20 73 74 72 69 |..>I hav|e a stri|
|000001a0| 6e 67 20 61 72 72 61 79 | 2c 20 61 6e 64 20 74 68 |ng array|, and th|
|000001b0| 65 72 65 20 61 72 65 20 | 64 75 70 6c 69 63 61 74 |ere are |duplicat|
|000001c0| 65 73 20 69 6e 73 69 64 | 65 20 69 74 2c 20 42 61 |es insid|e it, Ba|
|000001d0| 73 69 63 61 6c 6c 79 20 | 49 20 0d 3e 77 61 6e 74 |sically |I .>want|
|000001e0| 20 74 6f 20 70 61 72 73 | 65 20 6f 75 74 20 74 68 | to pars|e out th|
|000001f0| 65 20 61 72 72 61 79 20 | 69 6e 74 6f 20 61 20 6c |e array |into a l|
|00000200| 69 73 74 62 6f 78 20 73 | 6f 20 74 68 61 74 20 6f |istbox s|o that o|
|00000210| 6e 6c 79 20 6f 6e 65 20 | 63 6f 70 79 20 6f 66 20 |nly one |copy of |
|00000220| 65 61 63 68 20 0d 3e 73 | 74 72 69 6e 67 20 69 73 |each .>s|tring is|
|00000230| 20 6c 69 73 74 65 64 2e | 20 48 6f 77 20 61 6d 20 | listed.| How am |
|00000240| 49 20 74 6f 20 61 63 68 | 65 69 76 65 20 74 68 69 |I to ach|eive thi|
|00000250| 73 2e 2e 2e 2e 49 74 20 | 73 65 65 6d 73 20 74 6f |s....It |seems to|
|00000260| 20 62 65 20 68 61 72 64 | 65 72 20 74 68 61 6e 20 | be hard|er than |
|00000270| 0d 3e 69 74 20 73 6f 75 | 6e 64 73 2e 2e 2e 2e 2e |.>it sou|nds.....|
|00000280| 0d 0d 4a 6f 65 20 48 75 | 62 65 72 20 61 6c 72 65 |..Joe Hu|ber alre|
|00000290| 61 64 79 20 70 6f 73 74 | 65 64 20 61 20 73 6d 61 |ady post|ed a sma|
|000002a0| 72 74 20 73 6f 6c 75 74 | 69 6f 6e 20 62 79 20 73 |rt solut|ion by s|
|000002b0| 69 6d 70 6c 79 20 73 6f | 72 74 69 6e 67 20 74 68 |imply so|rting th|
|000002c0| 65 0d 61 72 72 61 79 20 | 28 6d 61 79 20 49 20 6d |e.array |(may I m|
|000002d0| 65 6e 74 69 6f 6e 20 6d | 79 20 73 6f 72 74 20 63 |ention m|y sort c|
|000002e0| 6c 61 73 73 20 61 67 61 | 69 6e 3f 20 73 65 65 20 |lass aga|in? see |
|000002f0| 68 74 74 70 3a 2f 2f 77 | 77 77 2e 74 65 6d 70 65 |http://w|ww.tempe|
|00000300| 6c 2e 6f 72 67 2f 72 62 | 29 0d 61 6e 64 20 74 68 |l.org/rb|).and th|
|00000310| 65 6e 20 63 68 65 63 6b | 69 6e 67 20 61 6c 6c 20 |en check|ing all |
|00000320| 61 64 6a 61 63 65 6e 74 | 20 65 6c 65 6d 65 6e 74 |adjacent| element|
|00000330| 73 2e 20 4f 66 20 63 6f | 75 72 73 65 2c 20 74 68 |s. Of co|urse, th|
|00000340| 69 73 20 61 29 20 63 68 | 61 6e 67 65 73 0d 74 68 |is a) ch|anges.th|
|00000350| 65 20 6f 72 64 65 72 20 | 6f 66 20 74 68 65 20 61 |e order |of the a|
|00000360| 72 72 61 79 20 61 6e 64 | 20 62 29 20 6d 61 79 20 |rray and| b) may |
|00000370| 74 61 6b 65 20 73 6f 6d | 65 20 74 69 6d 65 20 69 |take som|e time i|
|00000380| 6e 20 6c 61 72 67 65 20 | 61 72 72 61 79 73 2e 0d |n large |arrays..|
|00000390| 0d 48 6f 77 65 76 65 72 | 2c 20 69 6e 73 74 65 61 |.However|, instea|
|000003a0| 64 20 6f 66 20 73 6f 72 | 74 69 6e 67 20 74 68 65 |d of sor|ting the|
|000003b0| 20 61 72 72 61 79 20 69 | 74 73 65 6c 66 2c 20 79 | array i|tself, y|
|000003c0| 6f 75 20 63 6f 75 6c 64 | 20 63 72 65 61 74 65 20 |ou could| create |
|000003d0| 61 0d 73 65 63 6f 6e 64 | 20 61 72 72 61 79 20 74 |a.second| array t|
|000003e0| 68 61 74 20 73 69 6d 70 | 6c 79 20 63 6f 6e 73 69 |hat simp|ly consi|
|000003f0| 73 74 73 20 6f 66 20 70 | 6f 69 6e 74 65 72 73 20 |sts of p|ointers |
|00000400| 28 69 6e 64 65 78 20 6e | 75 6d 62 65 72 73 29 20 |(index n|umbers) |
|00000410| 74 6f 20 74 68 65 0d 6f | 72 69 67 69 6e 61 6c 20 |to the.o|riginal |
|00000420| 61 72 72 61 79 2e 20 57 | 68 65 6e 20 79 6f 75 20 |array. W|hen you |
|00000430| 73 6f 72 74 2c 20 79 6f | 75 20 73 6f 72 74 20 74 |sort, yo|u sort t|
|00000440| 68 61 74 20 32 6e 64 20 | 61 72 72 61 79 20 61 6e |hat 2nd |array an|
|00000450| 64 20 73 6f 20 74 68 65 | 0d 6f 72 69 67 69 6e 61 |d so the|.origina|
|00000460| 6c 20 6f 72 64 65 72 20 | 72 65 6d 61 69 6e 73 20 |l order |remains |
|00000470| 75 6e 63 68 61 6e 67 65 | 64 2e 0d 54 68 69 73 20 |unchange|d..This |
|00000480| 69 73 20 61 6c 73 6f 20 | 64 6f 61 62 6c 65 20 77 |is also |doable w|
|00000490| 69 74 68 20 6d 79 20 53 | 6f 72 74 69 6e 67 20 43 |ith my S|orting C|
|000004a0| 6c 61 73 73 2c 20 62 65 | 63 61 75 73 65 20 74 68 |lass, be|cause th|
|000004b0| 65 72 65 20 79 6f 75 20 | 63 61 6e 0d 70 72 6f 76 |ere you |can.prov|
|000004c0| 69 64 65 20 74 68 65 20 | 43 6f 6d 70 61 72 65 20 |ide the |Compare |
|000004d0| 61 6e 64 20 53 77 61 70 | 20 66 75 6e 63 74 69 6f |and Swap| functio|
|000004e0| 6e 73 20 62 79 20 79 6f | 75 72 73 65 6c 66 2e 0d |ns by yo|urself..|
|000004f0| 0d 48 65 72 65 27 73 20 | 61 6e 20 65 78 61 6d 70 |.Here's |an examp|
|00000500| 6c 65 20 28 61 6c 6c 20 | 6f 75 74 20 6f 66 20 6d |le (all |out of m|
|00000510| 79 20 68 65 61 64 2c 20 | 6e 6f 74 20 74 65 73 74 |y head, |not test|
|00000520| 65 64 29 2e 0d 0d 53 61 | 79 2c 20 79 6f 75 20 68 |ed)...Sa|y, you h|
|00000530| 61 76 65 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |ave the |original|
|00000540| 20 61 72 72 61 79 3a 0d | 0d 20 20 44 69 6d 20 55 | array:.|. Dim U|
|00000550| 6e 73 6f 72 74 65 64 4e | 61 6d 65 73 28 2e 2e 2e |nsortedN|ames(...|
|00000560| 29 20 61 73 20 53 74 72 | 69 6e 67 20 20 2f 2f 20 |) as Str|ing // |
|00000570| 68 65 72 65 20 74 68 65 | 20 6e 61 6d 65 73 20 61 |here the| names a|
|00000580| 72 65 20 69 6e 20 71 75 | 69 74 65 0d 20 20 20 20 |re in qu|ite. |
|00000590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005b0| 2f 2f 20 72 61 6e 64 6f | 6d 20 6f 72 64 65 72 20 |// rando|m order |
|000005c0| 61 6e 64 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 0d |and you |want to.|
|000005d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005f0| 20 20 20 20 2f 2f 20 6b | 65 65 70 20 74 68 65 6d | // k|eep them|
|00000600| 20 74 68 61 74 20 77 61 | 79 2e 0d 0d 4e 6f 77 20 | that wa|y...Now |
|00000610| 61 64 64 20 74 68 65 20 | 73 6f 72 74 65 72 20 61 |add the |sorter a|
|00000620| 72 72 61 79 3a 0d 0d 20 | 20 44 69 6d 20 53 6f 72 |rray:.. | Dim Sor|
|00000630| 74 65 64 49 6e 64 65 78 | 28 30 29 20 61 73 20 49 |tedIndex|(0) as I|
|00000640| 6e 74 65 67 65 72 0d 20 | 20 52 65 64 69 6d 20 53 |nteger. | Redim S|
|00000650| 6f 72 74 65 64 49 6e 64 | 65 78 28 55 42 6f 75 6e |ortedInd|ex(UBoun|
|00000660| 64 28 55 6e 73 6f 72 74 | 65 64 4e 61 6d 65 73 29 |d(Unsort|edNames)|
|00000670| 29 20 20 2f 2f 20 73 65 | 74 20 69 74 20 74 6f 20 |) // se|t it to |
|00000680| 74 68 65 20 73 61 6d 65 | 20 73 69 7a 65 0d 20 20 |the same| size. |
|00000690| 46 6f 72 20 69 20 3d 20 | 30 20 74 6f 20 55 42 6f |For i = |0 to UBo|
|000006a0| 75 6e 64 28 55 6e 73 6f | 72 74 65 64 4e 61 6d 65 |und(Unso|rtedName|
|000006b0| 73 29 0d 20 20 20 20 53 | 6f 72 74 65 64 49 6e 64 |s). S|ortedInd|
|000006c0| 65 78 28 69 29 20 3d 20 | 69 0d 20 20 45 6e 64 0d |ex(i) = |i. End.|
|000006d0| 0d 4e 6f 77 20 79 6f 75 | 20 68 61 76 65 20 61 6e |.Now you| have an|
|000006e0| 20 61 72 72 61 79 20 74 | 68 61 74 20 69 73 20 73 | array t|hat is s|
|000006f0| 6f 72 74 65 64 20 74 68 | 65 20 73 61 6d 65 20 77 |orted th|e same w|
|00000700| 61 79 20 61 73 20 74 68 | 65 20 6f 72 69 67 69 6e |ay as th|e origin|
|00000710| 61 6c 0d 6f 6e 65 20 73 | 6f 20 66 61 72 2e 20 4e |al.one s|o far. N|
|00000720| 6f 77 20 77 65 20 63 61 | 6e 20 73 6f 72 74 20 74 |ow we ca|n sort t|
|00000730| 68 69 73 20 61 72 72 61 | 79 20 75 73 69 6e 67 20 |his arra|y using |
|00000740| 6d 79 20 53 6f 72 74 20 | 43 6c 61 73 73 20 62 79 |my Sort |Class by|
|00000750| 0d 6a 75 73 74 20 69 6d | 70 6c 65 6d 65 6e 74 69 |.just im|plementi|
|00000760| 6e 67 20 74 68 65 20 53 | 6f 72 74 20 61 6e 64 20 |ng the S|ort and |
|00000770| 43 6f 6d 70 61 72 65 20 | 6d 65 74 68 6f 64 73 20 |Compare |methods |
|00000780| 69 6e 20 61 20 73 75 62 | 63 6c 61 73 73 28 21 29 |in a sub|class(!)|
|00000790| 0d 6f 72 20 49 6e 74 65 | 72 66 61 63 65 20 43 6c |.or Inte|rface Cl|
|000007a0| 61 73 73 20 28 52 42 32 | 20 6f 6e 6c 79 29 3a 0d |ass (RB2| only):.|
|000007b0| 0d 20 20 46 75 6e 63 74 | 69 6f 6e 20 43 6f 6d 70 |. Funct|ion Comp|
|000007c0| 61 72 65 20 28 6c 65 66 | 74 20 61 73 20 49 6e 74 |are (lef|t as Int|
|000007d0| 65 67 65 72 2c 20 72 69 | 67 68 74 20 61 73 20 49 |eger, ri|ght as I|
|000007e0| 6e 74 65 67 65 72 29 20 | 61 73 20 49 6e 74 65 67 |nteger) |as Integ|
|000007f0| 65 72 0d 20 20 20 20 44 | 69 6d 20 6c 2c 20 72 20 |er. D|im l, r |
|00000800| 61 73 20 53 74 72 69 6e | 67 0d 20 20 20 20 6c 20 |as Strin|g. l |
|00000810| 3d 20 55 6e 73 6f 72 74 | 65 64 4e 61 6d 65 73 28 |= Unsort|edNames(|
|00000820| 53 6f 72 74 65 64 49 6e | 64 65 78 28 6c 65 66 74 |SortedIn|dex(left|
|00000830| 29 29 0d 20 20 20 20 72 | 20 3d 20 55 6e 73 6f 72 |)). r| = Unsor|
|00000840| 74 65 64 4e 61 6d 65 73 | 28 53 6f 72 74 65 64 49 |tedNames|(SortedI|
|00000850| 6e 64 65 78 28 72 69 67 | 68 74 29 29 0d 20 20 20 |ndex(rig|ht)). |
|00000860| 20 69 66 20 6c 20 3d 20 | 72 20 74 68 65 6e 0d 20 | if l = |r then. |
|00000870| 20 20 20 20 20 72 65 74 | 75 72 6e 20 30 20 2f 2f | ret|urn 0 //|
|00000880| 20 74 68 65 79 20 61 72 | 65 20 65 71 75 61 6c 0d | they ar|e equal.|
|00000890| 20 20 20 20 65 6c 73 65 | 69 66 20 6c 20 3c 20 72 | else|if l < r|
|000008a0| 20 74 68 65 6e 0d 20 20 | 20 20 20 20 72 65 74 75 | then. | retu|
|000008b0| 72 6e 20 2d 31 20 2f 2f | 20 6c 65 66 74 20 69 73 |rn -1 //| left is|
|000008c0| 20 73 6d 61 6c 6c 6c 65 | 72 0d 20 20 20 20 65 6c | smallle|r. el|
|000008d0| 73 65 0d 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |se. | return |
|000008e0| 20 31 20 2f 2f 20 6c 65 | 66 74 20 69 73 20 6c 61 | 1 // le|ft is la|
|000008f0| 72 67 65 72 0d 20 20 20 | 20 65 6e 64 0d 20 20 45 |rger. | end. E|
|00000900| 6e 64 20 46 75 6e 63 74 | 69 6f 6e 0d 0d 20 20 53 |nd Funct|ion.. S|
|00000910| 75 62 20 53 77 61 70 20 | 28 6c 65 66 74 20 61 73 |ub Swap |(left as|
|00000920| 20 49 6e 74 65 67 65 72 | 2c 20 72 69 67 68 74 20 | Integer|, right |
|00000930| 61 73 20 49 6e 74 65 67 | 65 72 29 0d 20 20 20 20 |as Integ|er). |
|00000940| 2f 2f 20 69 6e 73 74 65 | 61 64 20 6f 66 20 73 77 |// inste|ad of sw|
|00000950| 61 70 70 69 6e 67 20 74 | 68 65 20 53 74 72 69 6e |apping t|he Strin|
|00000960| 67 73 20 77 65 20 6a 75 | 73 74 20 73 77 61 70 20 |gs we ju|st swap |
|00000970| 74 68 65 20 69 6e 64 65 | 78 65 73 20 68 65 72 65 |the inde|xes here|
|00000980| 0d 20 20 20 20 44 69 6d | 20 74 6d 70 20 61 73 20 |. Dim| tmp as |
|00000990| 49 6e 74 65 67 65 72 0d | 20 20 20 20 74 6d 70 20 |Integer.| tmp |
|000009a0| 3d 20 53 6f 72 74 65 64 | 49 6e 64 65 78 28 6c 65 |= Sorted|Index(le|
|000009b0| 66 74 29 0d 20 20 20 20 | 53 6f 72 74 65 64 49 6e |ft). |SortedIn|
|000009c0| 64 65 78 28 6c 65 66 74 | 29 20 3d 20 53 6f 72 74 |dex(left|) = Sort|
|000009d0| 65 64 49 6e 64 65 78 28 | 72 69 67 68 74 29 0d 20 |edIndex(|right). |
|000009e0| 20 20 20 53 6f 72 74 65 | 64 49 6e 64 65 78 28 72 | Sorte|dIndex(r|
|000009f0| 69 67 68 74 29 20 3d 20 | 74 6d 70 0d 20 20 45 6e |ight) = |tmp. En|
|00000a00| 64 20 53 75 62 0d 0d 54 | 6f 20 73 6f 72 74 20 74 |d Sub..T|o sort t|
|00000a10| 68 69 73 2c 20 63 61 6c | 6c 20 74 68 65 20 53 6f |his, cal|l the So|
|00000a20| 72 74 28 29 20 6d 65 74 | 68 6f 64 20 66 72 6f 6d |rt() met|hod from|
|00000a30| 20 6d 79 20 43 6c 61 73 | 73 2e 0d 0d 41 66 74 65 | my Clas|s...Afte|
|00000a40| 72 20 74 68 65 20 61 72 | 72 61 79 20 68 61 73 20 |r the ar|ray has |
|00000a50| 62 65 65 6e 20 73 6f 72 | 74 65 64 2c 20 79 6f 75 |been sor|ted, you|
|00000a60| 20 63 61 6e 20 66 69 6e | 64 20 74 68 65 20 64 75 | can fin|d the du|
|00000a70| 70 6c 69 63 61 74 65 73 | 3a 0d 0d 20 20 44 69 6d |plicates|:.. Dim|
|00000a80| 20 49 73 41 44 75 70 6c | 69 63 61 74 65 28 30 29 | IsADupl|icate(0)|
|00000a90| 20 61 73 20 42 6f 6f 6c | 65 61 6e 2c 20 69 2c 20 | as Bool|ean, i, |
|00000aa0| 6a 2c 20 6b 20 61 73 20 | 49 6e 74 65 67 65 72 0d |j, k as |Integer.|
|00000ab0| 20 20 52 65 64 69 6d 20 | 49 73 41 44 75 70 6c 69 | Redim |IsADupli|
|00000ac0| 63 61 74 65 28 55 42 6f | 75 6e 64 28 55 6e 73 6f |cate(UBo|und(Unso|
|00000ad0| 72 74 65 64 4e 61 6d 65 | 73 29 29 0d 20 20 69 20 |rtedName|s)). i |
|00000ae0| 3d 20 30 0d 20 20 6a 20 | 3d 20 53 6f 72 74 65 64 |= 0. j |= Sorted|
|00000af0| 49 6e 64 65 78 28 69 29 | 0d 20 20 77 68 69 6c 65 |Index(i)|. while|
|00000b00| 20 69 20 3c 20 55 42 6f | 75 6e 64 28 55 6e 73 6f | i < UBo|und(Unso|
|00000b10| 72 74 65 64 4e 61 6d 65 | 73 29 0d 20 20 20 20 69 |rtedName|s). i|
|00000b20| 20 3d 20 69 20 2b 20 31 | 0d 20 20 20 20 6b 20 3d | = i + 1|. k =|
|00000b30| 20 53 6f 72 74 65 64 49 | 6e 64 65 78 28 69 29 0d | SortedI|ndex(i).|
|00000b40| 20 20 20 20 69 66 20 55 | 6e 73 6f 72 74 65 64 4e | if U|nsortedN|
|00000b50| 61 6d 65 73 28 6a 29 20 | 3d 20 55 6e 73 6f 72 74 |ames(j) |= Unsort|
|00000b60| 65 64 4e 61 6d 65 73 28 | 6b 29 20 74 68 65 6e 0d |edNames(|k) then.|
|00000b70| 20 20 20 20 20 20 49 73 | 41 44 75 70 6c 69 63 61 | Is|ADuplica|
|00000b80| 74 65 28 6b 29 20 3d 20 | 74 72 75 65 0d 20 20 20 |te(k) = |true. |
|00000b90| 20 65 6e 64 0d 20 20 20 | 20 6a 20 3d 20 6b 0d 20 | end. | j = k. |
|00000ba0| 20 57 65 6e 64 0d 0d 41 | 66 74 65 72 20 74 68 61 | Wend..A|fter tha|
|00000bb0| 74 2c 20 79 6f 75 20 63 | 61 6e 20 64 65 63 69 64 |t, you c|an decid|
|00000bc0| 65 20 77 68 61 74 20 74 | 6f 20 64 6f 20 77 69 74 |e what t|o do wit|
|00000bd0| 68 20 79 6f 75 72 20 64 | 75 70 6c 69 63 61 74 65 |h your d|uplicate|
|00000be0| 73 3a 0d 54 68 65 20 41 | 72 72 61 79 20 49 73 41 |s:.The A|rray IsA|
|00000bf0| 44 75 70 6c 69 63 61 74 | 65 28 29 20 63 6f 6e 74 |Duplicat|e() cont|
|00000c00| 61 69 6e 73 20 74 72 75 | 65 20 66 6f 72 20 65 61 |ains tru|e for ea|
|00000c10| 63 68 20 4e 61 6d 65 0d | 74 68 61 74 20 69 73 20 |ch Name.|that is |
|00000c20| 61 20 64 75 70 6c 69 63 | 61 74 65 2e 0d 0d 54 68 |a duplic|ate...Th|
|00000c30| 6f 6d 61 73 0d 00 00 00 | 16 00 01 00 00 00 00 00 |omas....|........|
|00000c40| 0b 00 09 00 04 00 00 00 | 09 00 00 00 00 00 00 00 |........|........|
|00000c50| 00 00 30 00 00 00 01 00 | 00 00 04 00 00 00 00 00 |..0.....|........|
|00000c60| 00 00 02 54 45 58 54 00 | 00 01 00 00 00 00 00 00 |...TEXT.|........|
|00000c70| 00 00 00 73 74 79 6c 00 | 00 01 00 00 00 00 00 00 |...styl.|........|
|00000c80| 00 00 00 00 00 00 24 00 | 00 00 05 00 01 04 07 00 |......$.|........|
|00000c90| 4f 00 5a 01 f3 02 58 00 | 00 00 00 00 00 01 70 8c |O.Z...X.|......p.|
|00000ca0| 00 00 00 09 99 91 e0 00 | 00 00 00 00 00 01 00 00 |........|........|
|00000cb0| 00 0c 2b 00 00 0b 2b 00 | 00 00 6e 09 75 f7 00 33 |..+...+.|..n.u..3|
|00000cc0| 6a 00 00 00 1c 00 6e 00 | 03 54 45 58 54 00 00 00 |j.....n.|.TEXT...|
|00000cd0| 22 73 74 79 6c 00 00 00 | 2e 64 72 61 67 00 00 00 |"styl...|.drag...|
|00000ce0| 3a 6b 77 73 74 00 00 00 | 46 01 00 ff ff 00 00 00 |:kwst...|F.......|
|00000cf0| 00 00 00 00 00 01 00 ff | ff 00 00 0a b5 00 00 00 |........|........|
|00000d00| 00 00 80 ff ff 00 00 0a | cf 00 00 00 00 bf 4c ff |........|......L.|
|00000d10| ff 00 00 0b 03 00 d8 71 | 18 00 00 00 00 00 00 00 |.......q|........|
|00000d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+